package com.work.calculations;

import java.util.*;

import com.work.db.*;
import com.work.db.dao.WorkDayDao;

public class WorktimeCalculations {
	
	private static WorktimeCalculations instance;

	private WorktimeCalculations() {
	}
	
	public static WorktimeCalculations intance() {
		if (instance == null) {
			instance = new WorktimeCalculations();
		}
		return instance;
	}
	
	public List<Integer> getWorkMonthsId (int year) {
		List<NativeQueryParam> params = new ArrayList<NativeQueryParam>();
		params.add(new NativeQueryParam("year", year, false));
		
		WorkDayDao workDayDao = (WorkDayDao) DaoFactoryImpl.instance().getWorkDayDao();
		List<Integer> days = workDayDao.findByNativeQuery(SqlQuery.GET_WORK_MONTHS, params, Integer.class);
		
		return days;
	}
}
